///
/// ProjectName: ncmflutter
/// Author: youngchan
/// CreateDate: 2021/5/13 9:59 上午
/// Copyright: ©2021 NEW CORE Technology Co. Ltd. All rights reserved.
/// Description: 环境参数，通过打包自定义参数设置 --dart-define, `--dart-define=ENABLE_AUTO_UPDATE=true`
///

class EnvConfig {
  ///测试模式
  static const testMode = bool.fromEnvironment('TEST_MODE', defaultValue: true);

  ///启用自动更新
  static const enableAutoUpdate =
      bool.fromEnvironment('ENABLE_AUTO_UPDATE', defaultValue: true);

  ///安装渠道; 缺少const 无法获取--dart-define信息, https://github.com/flutter/flutter/issues/55870
  static const String _installChannel =
      String.fromEnvironment('INSTALL_CHANNEL');

  static String get installChannel =>
      _installChannel.isNotEmpty ? _installChannel : '官方';

  ///渠道id  默认官方的channelId：4a56789d420aa14b5af246b456c8b080
  static const channelId = String.fromEnvironment('CHANNEL_ID',
      defaultValue: '4a56789d420aa14b5af246b456c8b080');

  ///是否OEM定制
  static const isOEM = bool.fromEnvironment('OEM', defaultValue: false);

  ///是否私有部署
  static const isPrivate = bool.fromEnvironment('PRIVATE', defaultValue: false);

  ///api服务器地址
  static const defaultHost = String.fromEnvironment('HOST',
      defaultValue: 'https://sit.newcoretech.com');
}
